<template>
  <div class="company">
    <div class="company-title">{{companyInfo.company_name}}</div>
    <div class="company-time">{{companyInfo.created_at}}</div>
    <wxParse :content="companyInfo.detail"/>
  </div>
</template>

<script>
import wxParse from 'mpvue-wxparse'
export default {
  data(){
    return {
      companyInfo:{},
      id:""
    }
  },
  components:{
    wxParse
  },
  onLoad(options){
    this.id = options.id;
  },
  //下拉刷新
  onPullDownRefresh () {
    this.reqVipCompanyList();
  },
  mounted(){
    this.reqVipCompanyList();
  },
  methods:{
    async reqVipCompanyList(){
      let params = {
        id: this.id,
      };
      let res = await this.$api.getVipCompanyList(params);
      wx.stopPullDownRefresh()
      if(res.data.level == "success"){
        let data = res.data.data;
        this.companyInfo = data[0];
      }else{
        wx.showToast({
          title: '获取首页会员企业列表失败',
          icon: 'none',
          duration: 1000
        })
      }
    }, 
  }
}
</script>

<style lang="scss" scoped>
.company{
  padding: 0 40rpx;
  .company-title{
    line-height: 60rpx;
    font-weight: 600;
  }
  .company-time{
    font-size: 26rpx;
    color: #cccccc;
    margin-bottom: 20rpx;
  }
}
</style>